<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <script src="https://unpkg.com/vue@3"></script>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title></title>
</head>
    


<div id="app">
    
    <input v-model="message" placeholder="" />
    <button @click="submit">提交</button>
    <li v-for="index in lists">
        {{index.message}}
    </li>
</div>

<script>
  const { createApp } = Vue

  createApp({
    data() {
      return {
        message: '',
        lists:[]
      }
    },
    methods:{
        submit(){
            console.log(this.lists)
            this.lists.push({"message": this.message});
            this.message=""
            
        }
    }

  }).mount('#app')
</script>